package com.lagou.sqlSession;

import java.sql.SQLException;
import java.util.List;

public interface SqlSession {

    //查询所有
    public <E> List<E> selectList(String statementid,Object... params) throws Exception;


    //根据条件查询单个
    public <T> T selectOne(String statementid,Object... params) throws Exception;


    /**
     * Execute an insert statement.
     * @param statement Unique identifier matching the statement to execute.
     * @return int The number of rows affected by the insert.
     */
    int insert(String statement, Object... params) throws SQLException, NoSuchFieldException, ClassNotFoundException, IllegalAccessException;

    int update(String statement, Object... parameter) throws SQLException, NoSuchFieldException, ClassNotFoundException, IllegalAccessException;

    int delete(String statement, Object... parameter) throws SQLException, NoSuchFieldException, ClassNotFoundException, IllegalAccessException;



    //为Dao接口生成代理实现类
    public <T> T getMapper(Class<?> mapperClass);


}
